// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file trajectory_setpoint.cpp
 * This source file contains the definition of the described types in the IDL file.
 *
 * This file was generated by the tool gen.
 */

#ifdef _WIN32
// Remove linker warning LNK4221 on Visual Studio
namespace { char dummy; }
#endif

#include "trajectory_setpoint.h"
#include <fastcdr/Cdr.h>

#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

#include <utility>


trajectory_setpoint::trajectory_setpoint()
{
    // m_timestamp_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4550bb58
    m_timestamp_ = 0;
    // m_x_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4ec4f3a0
    m_x_ = 0.0;
    // m_y_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@223191a6
    m_y_ = 0.0;
    // m_z_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@49139829
    m_z_ = 0.0;
    // m_yaw_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@9597028
    m_yaw_ = 0.0;
    // m_yawspeed_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@6069db50
    m_yawspeed_ = 0.0;
    // m_vx_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4efbca5a
    m_vx_ = 0.0;
    // m_vy_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@1b7cc17c
    m_vy_ = 0.0;
    // m_vz_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@59662a0b
    m_vz_ = 0.0;
    // m_acceleration com.eprosima.idl.parser.typecode.AliasTypeCode@77fbd92c
    memset(&m_acceleration, 0, (3) * 4);
    // m_jerk com.eprosima.idl.parser.typecode.AliasTypeCode@77fbd92c
    memset(&m_jerk, 0, (3) * 4);
    // m_thrust com.eprosima.idl.parser.typecode.AliasTypeCode@77fbd92c
    memset(&m_thrust, 0, (3) * 4);

}

trajectory_setpoint::~trajectory_setpoint()
{












}

trajectory_setpoint::trajectory_setpoint(const trajectory_setpoint &x)
{
    m_timestamp_ = x.m_timestamp_;
    m_x_ = x.m_x_;
    m_y_ = x.m_y_;
    m_z_ = x.m_z_;
    m_yaw_ = x.m_yaw_;
    m_yawspeed_ = x.m_yawspeed_;
    m_vx_ = x.m_vx_;
    m_vy_ = x.m_vy_;
    m_vz_ = x.m_vz_;
    m_acceleration = x.m_acceleration;
    m_jerk = x.m_jerk;
    m_thrust = x.m_thrust;
}

trajectory_setpoint::trajectory_setpoint(trajectory_setpoint &&x)
{
    m_timestamp_ = x.m_timestamp_;
    m_x_ = x.m_x_;
    m_y_ = x.m_y_;
    m_z_ = x.m_z_;
    m_yaw_ = x.m_yaw_;
    m_yawspeed_ = x.m_yawspeed_;
    m_vx_ = x.m_vx_;
    m_vy_ = x.m_vy_;
    m_vz_ = x.m_vz_;
    m_acceleration = std::move(x.m_acceleration);
    m_jerk = std::move(x.m_jerk);
    m_thrust = std::move(x.m_thrust);
}

trajectory_setpoint& trajectory_setpoint::operator=(const trajectory_setpoint &x)
{

    m_timestamp_ = x.m_timestamp_;
    m_x_ = x.m_x_;
    m_y_ = x.m_y_;
    m_z_ = x.m_z_;
    m_yaw_ = x.m_yaw_;
    m_yawspeed_ = x.m_yawspeed_;
    m_vx_ = x.m_vx_;
    m_vy_ = x.m_vy_;
    m_vz_ = x.m_vz_;
    m_acceleration = x.m_acceleration;
    m_jerk = x.m_jerk;
    m_thrust = x.m_thrust;

    return *this;
}

trajectory_setpoint& trajectory_setpoint::operator=(trajectory_setpoint &&x)
{

    m_timestamp_ = x.m_timestamp_;
    m_x_ = x.m_x_;
    m_y_ = x.m_y_;
    m_z_ = x.m_z_;
    m_yaw_ = x.m_yaw_;
    m_yawspeed_ = x.m_yawspeed_;
    m_vx_ = x.m_vx_;
    m_vy_ = x.m_vy_;
    m_vz_ = x.m_vz_;
    m_acceleration = std::move(x.m_acceleration);
    m_jerk = std::move(x.m_jerk);
    m_thrust = std::move(x.m_thrust);

    return *this;
}

size_t trajectory_setpoint::getMaxCdrSerializedSize(size_t current_alignment)
{
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += ((3) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += ((3) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += ((3) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);



    return current_alignment - initial_alignment;
}

size_t trajectory_setpoint::getCdrSerializedSize(const trajectory_setpoint& data, size_t current_alignment)
{
    (void)data;
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    if ((3) > 0)
    {
        current_alignment += ((3) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
    }

    if ((3) > 0)
    {
        current_alignment += ((3) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
    }

    if ((3) > 0)
    {
        current_alignment += ((3) * 4) + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);
    }


    return current_alignment - initial_alignment;
}

void trajectory_setpoint::serialize(eprosima::fastcdr::Cdr &scdr) const
{

    scdr << m_timestamp_;
    scdr << m_x_;
    scdr << m_y_;
    scdr << m_z_;
    scdr << m_yaw_;
    scdr << m_yawspeed_;
    scdr << m_vx_;
    scdr << m_vy_;
    scdr << m_vz_;
    scdr << m_acceleration;

    scdr << m_jerk;

    scdr << m_thrust;

}

void trajectory_setpoint::deserialize(eprosima::fastcdr::Cdr &dcdr)
{

    dcdr >> m_timestamp_;
    dcdr >> m_x_;
    dcdr >> m_y_;
    dcdr >> m_z_;
    dcdr >> m_yaw_;
    dcdr >> m_yawspeed_;
    dcdr >> m_vx_;
    dcdr >> m_vy_;
    dcdr >> m_vz_;
    dcdr >> m_acceleration;

    dcdr >> m_jerk;

    dcdr >> m_thrust;

}

/*!
 * @brief This function sets a value in member timestamp_
 * @param _timestamp_ New value for member timestamp_
 */
void trajectory_setpoint::timestamp_(uint64_t _timestamp_)
{
m_timestamp_ = _timestamp_;
}

/*!
 * @brief This function returns the value of member timestamp_
 * @return Value of member timestamp_
 */
uint64_t trajectory_setpoint::timestamp_() const
{
    return m_timestamp_;
}

/*!
 * @brief This function returns a reference to member timestamp_
 * @return Reference to member timestamp_
 */
uint64_t& trajectory_setpoint::timestamp_()
{
    return m_timestamp_;
}

/*!
 * @brief This function sets a value in member x_
 * @param _x_ New value for member x_
 */
void trajectory_setpoint::x_(float _x_)
{
m_x_ = _x_;
}

/*!
 * @brief This function returns the value of member x_
 * @return Value of member x_
 */
float trajectory_setpoint::x_() const
{
    return m_x_;
}

/*!
 * @brief This function returns a reference to member x_
 * @return Reference to member x_
 */
float& trajectory_setpoint::x_()
{
    return m_x_;
}

/*!
 * @brief This function sets a value in member y_
 * @param _y_ New value for member y_
 */
void trajectory_setpoint::y_(float _y_)
{
m_y_ = _y_;
}

/*!
 * @brief This function returns the value of member y_
 * @return Value of member y_
 */
float trajectory_setpoint::y_() const
{
    return m_y_;
}

/*!
 * @brief This function returns a reference to member y_
 * @return Reference to member y_
 */
float& trajectory_setpoint::y_()
{
    return m_y_;
}

/*!
 * @brief This function sets a value in member z_
 * @param _z_ New value for member z_
 */
void trajectory_setpoint::z_(float _z_)
{
m_z_ = _z_;
}

/*!
 * @brief This function returns the value of member z_
 * @return Value of member z_
 */
float trajectory_setpoint::z_() const
{
    return m_z_;
}

/*!
 * @brief This function returns a reference to member z_
 * @return Reference to member z_
 */
float& trajectory_setpoint::z_()
{
    return m_z_;
}

/*!
 * @brief This function sets a value in member yaw_
 * @param _yaw_ New value for member yaw_
 */
void trajectory_setpoint::yaw_(float _yaw_)
{
m_yaw_ = _yaw_;
}

/*!
 * @brief This function returns the value of member yaw_
 * @return Value of member yaw_
 */
float trajectory_setpoint::yaw_() const
{
    return m_yaw_;
}

/*!
 * @brief This function returns a reference to member yaw_
 * @return Reference to member yaw_
 */
float& trajectory_setpoint::yaw_()
{
    return m_yaw_;
}

/*!
 * @brief This function sets a value in member yawspeed_
 * @param _yawspeed_ New value for member yawspeed_
 */
void trajectory_setpoint::yawspeed_(float _yawspeed_)
{
m_yawspeed_ = _yawspeed_;
}

/*!
 * @brief This function returns the value of member yawspeed_
 * @return Value of member yawspeed_
 */
float trajectory_setpoint::yawspeed_() const
{
    return m_yawspeed_;
}

/*!
 * @brief This function returns a reference to member yawspeed_
 * @return Reference to member yawspeed_
 */
float& trajectory_setpoint::yawspeed_()
{
    return m_yawspeed_;
}

/*!
 * @brief This function sets a value in member vx_
 * @param _vx_ New value for member vx_
 */
void trajectory_setpoint::vx_(float _vx_)
{
m_vx_ = _vx_;
}

/*!
 * @brief This function returns the value of member vx_
 * @return Value of member vx_
 */
float trajectory_setpoint::vx_() const
{
    return m_vx_;
}

/*!
 * @brief This function returns a reference to member vx_
 * @return Reference to member vx_
 */
float& trajectory_setpoint::vx_()
{
    return m_vx_;
}

/*!
 * @brief This function sets a value in member vy_
 * @param _vy_ New value for member vy_
 */
void trajectory_setpoint::vy_(float _vy_)
{
m_vy_ = _vy_;
}

/*!
 * @brief This function returns the value of member vy_
 * @return Value of member vy_
 */
float trajectory_setpoint::vy_() const
{
    return m_vy_;
}

/*!
 * @brief This function returns a reference to member vy_
 * @return Reference to member vy_
 */
float& trajectory_setpoint::vy_()
{
    return m_vy_;
}

/*!
 * @brief This function sets a value in member vz_
 * @param _vz_ New value for member vz_
 */
void trajectory_setpoint::vz_(float _vz_)
{
m_vz_ = _vz_;
}

/*!
 * @brief This function returns the value of member vz_
 * @return Value of member vz_
 */
float trajectory_setpoint::vz_() const
{
    return m_vz_;
}

/*!
 * @brief This function returns a reference to member vz_
 * @return Reference to member vz_
 */
float& trajectory_setpoint::vz_()
{
    return m_vz_;
}

/*!
 * @brief This function copies the value in member acceleration
 * @param _acceleration New value to be copied in member acceleration
 */
void trajectory_setpoint::acceleration(const trajectory_setpoint__float_array_3 &_acceleration)
{
m_acceleration = _acceleration;
}

/*!
 * @brief This function moves the value in member acceleration
 * @param _acceleration New value to be moved in member acceleration
 */
void trajectory_setpoint::acceleration(trajectory_setpoint__float_array_3 &&_acceleration)
{
m_acceleration = std::move(_acceleration);
}

/*!
 * @brief This function returns a constant reference to member acceleration
 * @return Constant reference to member acceleration
 */
const trajectory_setpoint__float_array_3& trajectory_setpoint::acceleration() const
{
    return m_acceleration;
}

/*!
 * @brief This function returns a reference to member acceleration
 * @return Reference to member acceleration
 */
trajectory_setpoint__float_array_3& trajectory_setpoint::acceleration()
{
    return m_acceleration;
}
/*!
 * @brief This function copies the value in member jerk
 * @param _jerk New value to be copied in member jerk
 */
void trajectory_setpoint::jerk(const trajectory_setpoint__float_array_3 &_jerk)
{
m_jerk = _jerk;
}

/*!
 * @brief This function moves the value in member jerk
 * @param _jerk New value to be moved in member jerk
 */
void trajectory_setpoint::jerk(trajectory_setpoint__float_array_3 &&_jerk)
{
m_jerk = std::move(_jerk);
}

/*!
 * @brief This function returns a constant reference to member jerk
 * @return Constant reference to member jerk
 */
const trajectory_setpoint__float_array_3& trajectory_setpoint::jerk() const
{
    return m_jerk;
}

/*!
 * @brief This function returns a reference to member jerk
 * @return Reference to member jerk
 */
trajectory_setpoint__float_array_3& trajectory_setpoint::jerk()
{
    return m_jerk;
}
/*!
 * @brief This function copies the value in member thrust
 * @param _thrust New value to be copied in member thrust
 */
void trajectory_setpoint::thrust(const trajectory_setpoint__float_array_3 &_thrust)
{
m_thrust = _thrust;
}

/*!
 * @brief This function moves the value in member thrust
 * @param _thrust New value to be moved in member thrust
 */
void trajectory_setpoint::thrust(trajectory_setpoint__float_array_3 &&_thrust)
{
m_thrust = std::move(_thrust);
}

/*!
 * @brief This function returns a constant reference to member thrust
 * @return Constant reference to member thrust
 */
const trajectory_setpoint__float_array_3& trajectory_setpoint::thrust() const
{
    return m_thrust;
}

/*!
 * @brief This function returns a reference to member thrust
 * @return Reference to member thrust
 */
trajectory_setpoint__float_array_3& trajectory_setpoint::thrust()
{
    return m_thrust;
}

size_t trajectory_setpoint::getKeyMaxCdrSerializedSize(size_t current_alignment)
{
    size_t current_align = current_alignment;















    return current_align;
}

bool trajectory_setpoint::isKeyDefined()
{
   return false;
}

void trajectory_setpoint::serializeKey(eprosima::fastcdr::Cdr &scdr) const
{
    (void) scdr;
     
     
     
     
     
     
     
     
     
     
     
     
}
